home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993 April: Penguin on DISC / ADC Developer CD (1993-04) (''Penguin On DISC'')_iso / Dev.CD Apr 93.iso / Utilities / MPW Interfaces 7.1 Beta / AIncludes / TextServices.a < prev    next >
Encoding:
Text File  |  1992-08-28  |  6.7 KB  |  274 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        TextServices.a
  3. ;
  4. ;    Contains:    Text Services Manager Assembler Definitions.
  5. ;
  6. ;    Written by:    Kenny SC. Tung
  7. ;
  8. ;    Copyright:    © 1991-1992 by Apple Computer, Inc., all rights reserved.
  9. ;
  10. ;    Change History (most recent first):
  11. ;
  12. ;
  13.  
  14.  
  15.  
  16. ;
  17. ; •• Note: _TSMDispatch, and selectors will be moved to TRAP.a when everything is settled.
  18. ;
  19.  
  20.  
  21.  
  22.     IF &TYPE('__TSMAInclude__') = 'UNDEFINED' THEN
  23. __TSMAInclude__        SET        1
  24.  
  25.  
  26. kTSMVersion                        equ        1            ; Version of the Text Services Manager
  27. kTextService                    equ        'tsvc'    ; component type for the component description
  28. kInputMethodService            equ        'inpm'    ; component subtype for the component description
  29. ;;-------------------------------------------------------------------------;;
  30.  
  31.  
  32. tsmUnsupScriptLanguageErr    EQU        -2500        ;
  33. tsmInputMethodNotFoundErr    EQU        -2501        ;
  34. tsmNotAnAppErr                    EQU        -2502        ; not an application error
  35. tsmAlreadyRegisteredErr        EQU        -2503        ; want to register again error
  36. tsmNeverRegisteredErr        EQU        -2504        ; app is not TSM aware error
  37. tsmInvalidDocIDErr            EQU        -2505        ; invalid TSM documentation id
  38. tsmTSMDocBusyErr                EQU        -2506        ; document is still active
  39. tsmDocNotActiveErr            EQU        -2507        ; document is NOT active
  40. tsmNoOpenTSErr                    EQU        -2508        ; no open text service
  41. tsmCantOpenComponentErr        EQU        -2509        ; can't open the component
  42. tsmTextServiceNotFoundErr    EQU        -2510        ; no text service found
  43. tsmDocumentOpenErr            EQU        -2511        ; there are open documents
  44. tsmUseInputWindowErr            EQU        -2512        ; not TSM aware because we are using input window
  45. tsmTSHasNoMenuErr                EQU        -2513        ; the text service has no menu
  46. tsmTSNotOpenErr                EQU        -2514        ; no open text service to close
  47. tsmComponentAlreadyOpenErr    EQU        -2515        ; text service already opened for the document
  48.  
  49. tsmInputMethodIsOldErr        EQU        -2516        ; returned by GetDefaultInputMethod ONLY
  50. tsmScriptHasNoIMErr            EQU        -2517        ; script has no imput method or is using old IM.
  51. tsmUnsupportedTypeErr        EQU        -2518        ; unSupported interface type error
  52. tsmUnknownErr                    EQU        -2519        ; any other errors
  53.  
  54. ;;-------------------------------------------------------------------------;;
  55.  
  56.  
  57.  
  58.  
  59.  
  60. _TSMDispatch                OPWORD        $AA54    ; should be moved later
  61. TSMTrapNumber                EQU            $AA54
  62.  
  63.  
  64. ;    Text Services Manager function selectors ...
  65.  
  66. kNewTSMDocument                equ        0        ; create new TSM aware document
  67. kDeleteTSMDocument            equ        1        ; delete TSM aware document
  68. kActivateTSMDocument            equ        2        ; activate TSM aware document
  69. kDeactivateTSMDocument        equ        3        ; deactivate TSM aware document
  70. kTSMEvent                        equ        4        ; pass all events to TSM
  71. kTSMMenuSelect                    equ        5        ; pass menu selection to TSM
  72. kSetTSMCursor                    equ        6        ; set the cursor
  73. kFixTSMDocument                equ        7        ; terminate text services
  74. kGetServiceList                equ        8        ; get all text service components
  75. kOpenTextService                equ        9        ; open  the text service
  76. kCloseTextService                equ        10        ; close the text service
  77. kSendAEFromTSMComponent        equ        11        ; send Apple Event from component to client
  78.  
  79.  
  80. ;; Utilities ...
  81.  
  82. kSetDefaultInputMethod        equ        12        ;
  83. kGetDefaultInputMethod        equ        13        ; (Get = D)
  84. kSetTextServiceLanguage        equ        14        ; 
  85. kGetTextServiceLanguage        equ        15        ; 
  86. kUseInputWindow                equ        16        ; 
  87. kNewServiceWindow                equ        17        ; 
  88. kCloseServiceWindow            equ        18        ; 
  89. kGetFrontServiceWindow        equ        19        ; 
  90.  
  91.  
  92. kInitTSMAwareApplication    equ        20        ; claim TSM aware application
  93. kCloseTSMAwareApplication    equ        21        ; application deregisters itself as TSM aware
  94. kFindServiceWindow            equ        23
  95.  
  96. ;;-------------------------------------------------------------------------;;
  97.  
  98.  
  99.  
  100. ;; Low level routines which are dispatched directly to the Component Manager ...
  101. kCMGetScriptLangSupport        equ        $00040001            ; 
  102. kCMInitiateTextService        equ        $00000002            ; 
  103. kCMTerminateTextService        equ        $00000003            ; 
  104. kCMActivateTextService        equ        $00000004            ; 
  105. kCMDeactivateTextService    equ        $00000005            ; 
  106. kCMTextServiceEvent            equ        $00060006            ; 
  107. kCMGetTextServiceMenu        equ        $00040007            ; 
  108. kCMTextServiceMenuSelect    equ        $00060008            ; 
  109. kCMFixTextService                equ        $00000009            ; 
  110. kCMSetTextServiceCursor        equ        $0004000A            ; 
  111.  
  112. ;;-------------------------------------------------------------------------;;
  113.  
  114.  
  115.  
  116. ;; trap routine macros ...
  117.  
  118.                   macro
  119.                   _NewTSMDocument
  120.                   move.w  #kNewTSMDocument,d0
  121.                   _TSMDispatch
  122.                   endm
  123.  
  124.  
  125.                   macro
  126.                   _DeleteTSMDocument
  127.                   move.w  #kDeleteTSMDocument,d0
  128.                   _TSMDispatch
  129.                   endm
  130.  
  131.  
  132.                   macro
  133.                   _ActivateTSMDocument
  134.                   move.w  #kActivateTSMDocument,d0
  135.                   _TSMDispatch
  136.                   endm
  137.  
  138.  
  139.                   macro
  140.                   _DeactivateTSMDocument
  141.                   move.w  #kDeactivateTSMDocument,d0
  142.                   _TSMDispatch
  143.                   endm
  144.   
  145.                   macro
  146.                   _TSMEvent
  147.                   move.w  #kTSMEvent,d0
  148.                   _TSMDispatch
  149.                   endm
  150.   
  151.                   macro
  152.                   _TSMMenuSelect
  153.                   move.w  #kTSMMenuSelect,d0
  154.                   _TSMDispatch
  155.                   endm
  156.  
  157.                   macro
  158.                   _SetTSMCursor
  159.                   move.w  #kSetTSMCursor,d0
  160.                   _TSMDispatch
  161.                   endm
  162.  
  163.                   macro
  164.                   _FixTSMDocument
  165.                   move.w  #kFixTSMDocument,d0
  166.                   _TSMDispatch
  167.                   endm
  168.  
  169.                   macro
  170.                   _GetServiceList
  171.                   move.w  #kGetServiceList,d0
  172.                   _TSMDispatch
  173.                   endm
  174.  
  175.                   macro
  176.                   _OpenTextService
  177.                   move.w  #kOpenTextService,d0
  178.                   _TSMDispatch
  179.                   endm
  180.  
  181.                 macro
  182.                   _CloseTextService
  183.                   move.w  #kCloseTextService,d0
  184.                   _TSMDispatch
  185.                   endm
  186.                 
  187.                   macro
  188.                   _SendAEFromTSMComponent
  189.                   move.w  #kSendAEFromTSMComponent,d0                        ; kSendAEFromTSMComponent = 11
  190.                   _TSMDispatch
  191.                   endm
  192.  
  193.                   macro
  194.                   _InitTSMAwareApplication
  195.                   move.w  #kInitTSMAwareApplication,d0
  196.                   _TSMDispatch
  197.                   endm
  198.  
  199.  
  200.                   macro
  201.                   _CloseTSMAwareApplication
  202.                   move.w  #kCloseTSMAwareApplication,d0
  203.                   _TSMDispatch
  204.                   endm
  205.                 
  206.                   macro
  207.                   _SetDefaultInputMethod
  208.                   move.w  #kSetDefaultInputMethod,d0
  209.                   _TSMDispatch
  210.                   endm
  211.  
  212.                   macro
  213.                   _GetDefaultInputMethod
  214.                   move.w  #kGetDefaultInputMethod,d0
  215.                   _TSMDispatch
  216.                   endm
  217.  
  218.                   macro
  219.                   _SetTextServiceLanguage
  220.                   move.w  #kSetTextServiceLanguage,d0
  221.                   _TSMDispatch
  222.                   endm
  223.  
  224.                   macro
  225.                   _GetTextServiceLanguage
  226.                   move.w  #kGetTextServiceLanguage,d0
  227.                   _TSMDispatch
  228.                   endm
  229.  
  230.                   macro
  231.                   _UseInputWindow
  232.                   move.w  #kUseInputWindow,d0
  233.                   _TSMDispatch
  234.                   endm
  235.  
  236.                   macro
  237.                   _NewServiceWindow
  238.                   move.w  #kNewServiceWindow,d0
  239.                   _TSMDispatch
  240.                   endm
  241.  
  242.                   macro
  243.                   _CloseServiceWindow
  244.                   move.w  #kCloseServiceWindow,d0
  245.                   _TSMDispatch
  246.                   endm
  247.  
  248.                   macro
  249.                   _GetFrontServiceWindow
  250.                   move.w  #kGetFrontServiceWindow,d0
  251.                   _TSMDispatch
  252.                   endm
  253.  
  254.                   macro
  255.                   _FindServiceWindow
  256.                   move.w  #kFindServiceWindow,d0
  257.                   _TSMDispatch
  258.                   endm
  259.  
  260.  
  261. kUnknownScript        EQU            $FFFF                ; undefined script
  262. kUnknownLanguage    EQU            $FFFF                ; undefined language
  263.  
  264.  
  265. ScriptLanguageRec    RECORD        0
  266. fScript                ds.w            1                     ; (word) script code
  267. fLanguage            ds.w            1                     ; (word) language code
  268.                         ENDR
  269.  
  270.  
  271.  
  272.  
  273.  
  274.         ENDIF                ; ...already included